package com.aaa.controller.yy;


import com.aaa.pojo.ResultBean;
import com.aaa.pojo.yy.Log;

import com.aaa.service.yy.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@RestController
@RequestMapping("/Log")
public class LogController {
    @Autowired
    private LogService logService;

    @RequestMapping("/findAllLog")
    public ResultBean Log(String page, String limit){
        int count = logService.findCount();
        List<Log> allLog = logService.findAllLog(page, limit);
        ResultBean resultBean = new ResultBean();
        resultBean.setCode(0);
        resultBean.setMsg("");
        resultBean.setCount(count);
        resultBean.setData(allLog);
        return  resultBean;

    }
    @RequestMapping({"/toShowLog.do"})
    public ModelAndView toFormsFpa(ModelAndView modelAndView) {
        modelAndView.setViewName("showLog");
        return modelAndView;
    }
}
